package com.masiyi.springsecuritydemo.dao;

import com.masiyi.springsecuritydemo.entity.Role;
import com.masiyi.springsecuritydemo.entity.UserDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {
    //根据用户名查询用户
    UserDetail loadUserByUsername(String username);
  	
  	//根据用户id查询角色
  	List<Role> getRolesByUid(Integer uid);

    Boolean insertUser(@Param("userDetailInfo") UserDetail userDetailInfo);

    //根据用户 id 获取角色信息
    List<Role> getUserRoleByUid(Integer uid);
}